<template>
	<div class="goods">
		<img
			:src="data.itemImg | image_ali"
			@click.stop="openWindow(data, 'taobao')"
			class="goods-img cursor"
			alt
		/>
		<div class="goods-content">
			<div class="goods-content-title cursor" @click.stop="openWindow(data, 'taobao')">
				{{ data.itemTitle }}
			</div>
			<div class="goods-content-price">
				<div class="shop">{{ data.sellerShopTitle }}</div>
				<!-- <div class="original" style="margin-left:10px">
					原价：¥{{ data.alipayTotalPrice }}
				</div> -->
				<div class="activity" style="margin-left:130px;text-align:right;padding-right:20px">
					¥{{ data.itemPrice }}
				</div>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	props: ['data'],
	mounted() {},
	methods: {
		openWindow(data, type = 'else') {
			if (type == 'taobao') {
				window.open(data.itemLink, '_blank');
				return;
			}
			this.$emit('showdetail', {
				product: data.itemTitle,
				itemId: data.itemId,
				itemLink: data.itemLink
			});
		}
	}
};
</script>

<style lang="stylus" scoped>
.goods {
	display: flex;
	align-items: center;
	padding: 5px 10px;

	.goods-img {
		width: 61px;
		height: 61px;
		border: solid 5px #fff;
		border-radius: 8px;
	}

	.goods-content {
		display: flex;
		height 63px
		flex-direction: column;
		justify-content space-between
		margin-left: 15px;
		text-align: left;
		width: calc(100% - 90px);
		color #43425D
		font-weight:500;
		font-size 14px
		.goods-content-title {
			width: 100%;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			transition .3s
			&:hover {
				color $main-color
			}
		}
		.goods-content-price {
			display flex
			// flex-direction column
			div{
				width 150px
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}

		.goods-content-orther {
			span {
				margin-left: 10px;
			}
		}
	}
}
</style>
